<?php
defined('_JEXEC') or die;
abstract class RaovatHelper{
	
	public static function addSubmenu($submenu){
	
		JHtmlSidebar::addEntry(JText::_('Raovat Manager'), 'index.php?option=com_raovat', $submenu == 'raovats');
		JHtmlSidebar::addEntry(JText::_('Raovat Category'),'index.php?option=com_categories&extension=com_raovat',	$submenu == 'categories');
	}
	
	public static function getActions($messageId = 0){
		$user	= JFactory::getUser();
		$result	= new JObject;
 
		if (empty($messageId)) {
			$assetName = 'com_raovat';
		}
		else {
			$assetName = 'com_raovat.message.'.(int) $messageId;
		}
 
		$actions = array(
			'core.admin', 'core.manage', 'core.create', 'core.edit', 'core.delete'
		);
 
		foreach ($actions as $action) {
			$result->set($action,	$user->authorise($action, $assetName));
		}
 
		return $result;
	}
}
